<!-- <template lang="">
  <div class="content">
    <div class="main">
    <el-tabs v-model="activeName">
      <el-tab-pane label="客户" name="first" >
        <custem></custem>
      </el-tab-pane>
      <el-tab-pane label="联系人" name="second">
        <custem-linkman></custem-linkman>
      </el-tab-pane>
     
    </el-tabs>
  </div>
  </div>
</template>
<script>
  // import Custem from '@/components/Custem.vue'
  // import CustemLinkman from '@/components/CustemLinkman.vue'
  // import CommonTable1 from '@/components/CommonTable1.vue'
  export default {
    name: 'staff',
    // components: {
    //   Custem,CustemLinkman
    // },
    data() {
      return {
        activeName: 'first',
      }
    },
    mounted() {
      this.getUserList()
    },
    methods: {

      columnFormat(row, column) {
        switch (column.property) {
          case "userType":
            var userTypeMap = ["", "", "个人", "单位"]
            var value = userTypeMap[Number(row[column.property])]
            break;
        }
        return value;
      },
      setCurrent(row) {
        this.$refs.singleTable.setCurrentRow(row);
      },
      handleSizeChange(val) {
        // alert(`每页 ${val} 条`);
        this.size = val
        this.getUserList()
      },
      handleCurrentChange(val) {
        // alert(`当前页: ${val}`);
        this.current = val
        this.getUserList()
      },
      // 获取客户列表
      async getUserList() {
        // 解构出参数
        const {
          current,
          size,
          userType,
          username,
        } = this;
        var data = {
          current: current,
          size: size,
          userType: "23"
        }
        if (username != '') {
          data.username = username
        }
        let result = await this.$API.user.reqUserList(data)
        this.total = result.data.total;
        this.userList = result.data.data
      },
      // 客户详情
      // detailRow(){
      //   if (this.currentRow == null) {
      //     this.$message("请选择一行进行操作");
      //   } else {
      //     this.$router.push({
      //     path: '/custem/detail',
      //     name: 'custemDetail',
      //     query: {
      //       userId: this.currentRow.userId,
      //     }
      //   });
      //   }
      // },
      // 删除客户
      rowClick(row) {
        this.currentRow = row
      },
      deleteRow() {
        if (this.currentRow == null) {
          this.$message("请选择一行进行删除操作");
        } else {
          this.$confirm("确认删除客户吗？", "提示", {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            var data = {
              userId: this.currentRow.userId
            }
            this.$API.user.deleteStaffy(data).then(res => {
              if (res.data.code == 200) {
                this.$message.success("删除成功！");
                this.getUserList()
              } else {
                this.$message.error("删除失败！");
              }
            })
          })
        }
      },
      async usernameInput() {
        this.getUserList()
      },
      goto() {
        this.$router.push({
          path: '/InsertCustem'
        });
      },
      handleSelectionChange(val) {
        console.log(val)
        this.currentRow = val;
        this.$router.push({
          path: '/custem/detail',
          name: 'custemDetail',
          query: {
            userId: this.currentRow.userId,
          }
        });
      }
    }
  }

</script> -->
<!-- <style scoped>
  @import "../../../style/style.css";

  .main {
    border: 0px solid #000;
    border-radius: 10px;
    overflow: hidden;
  }

  .el-button {
    background-image: linear-gradient(to right, #0060ff, #0005cf);
    color: #fff;
    font-size: 16px;
    width: 90px;
    height: 39px;
    border-radius: 50px;
  }

  .tabs>>>.el-table th.el-table__cell {
    background-color: rgba(215, 228, 255, 0.774);

  }
  .tabs>>>.el-table .el-table_1_column_5,.el-table_1_column_3,.el-table_1_column_4{
    text-align: center;
  }
  .tabs>>>.el-table .el-table_1_column_3{
    text-align: center;
  }
  .tabs>>>.el-table .el-table_1_column_4{
    text-align: center;
  }
  .tabs>>>.el-table .el-table_1_column_10{
    text-align: center;
  }
  .tabs>>>.el-table .el-table_1_column_5_column_6{
    text-align: center;
  }
  .tabs>>>.el-table .el-table_1_column_5_column_7{
    text-align: center;
  }
  .search .left {
    padding-left: 20px;
  }

  .search .left>>>.el-select .el-input {
    background-color: #f5f5f7;
    width: 200px;
    margin-left: 20px;
    border-radius: 50px;
    overflow: hidden;
    height: 40px;
  }

  .search .left>>>.el-input__icon {
    color: #000;
    font-weight: 600;
  }

  .search .left>>>.el-select .el-input .el-select__caret {
    color: #000;
  }

  .search .right {
    padding-right: 40px;
  }

  .search>>>.el-input__inner {
    background-color: #f5f5f7;
  }
</style> -->